import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/owner/list',
    method: 'get',
    params: query
  })
}

export function getTotal(data) {
  return request({
    url: '/owner/query/online',
    method: 'get',
    data
  })
}

export function searchList(data) {
  console.log(data)
  return request({
    url: '/owner/search',
    method: 'get',
    params: data
  })
}

export function stopCar(id) {
  console.log(id)
  return request({
    url: '/owner/service',
    method: 'put',
    params: { 'id': id, 'state': -2 }
  })
}
export function backCar(id) {
  console.log(id)
  return request({
    url: '/owner/service',
    method: 'put',
    params: { 'id': id, 'state': 1 }
  })
}
export function getOwnerDetail(id) {
  return request({
    url: '/owner/info/' + id,
    method: 'get'
  })
}
export function getOwnerOrderList(id) {
  return request({
    url: '/owner/order/record/' + id,
    method: 'get'
  })
}
export function addPic(data) {
  return request({
    url: '/chauffeur/save/approve/info',
    method: 'POST',
    data: data
  })
}
export function updateArticle(data) {
  return request({
    url: '/owner/update',
    method: 'PUT',
    data: data
  })
}
